package com.soft.cart.service;

import com.soft.entity.TCart;
import com.soft.service.TCartService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@SpringBootTest
@RunWith(SpringRunner.class)
public class testCartService {
    @Autowired
    TCartService tCartService;

    @Test
    public void testFindAllProductByUserId(){
        System.out.println(tCartService.findAllProductByUserId(4));
    }

    @Test
    public void testFindAllCartAssociateProductByUserId(){
        System.out.println(tCartService.findAllCartAssociateProductByUserId(4));
    }
    @Test
    public void testuserAddCart(){
        TCart tCart = new TCart();
        tCart.setUserId(4);
        tCart.setCount(1);
        tCart.setProductId(4);
//        tCart.setId(4);
        System.out.println(tCart);
        System.out.println(tCartService.userAddCart(tCart));
    }

}
